#pragma once
#ifndef ___GOBJECT___
#include "Sprite.h"
#include "DirectX.h"
#include "Polygon.h"
#include "ResourceManager.h"
#include "Screen.h"
#include <memory>

#endif

class GObject
{
protected:
	float _x,_y;

	float _stepPercent;

	std::shared_ptr<Sprite> _sprite;

	bool _isMovable;

	CResourceManager* _rm;

	Vector _lastTranslateVector;

public:
	GObject(void);

	GObject(float x,float y, int Width, int Height);

	GObject(float x,float y, int resourceName,CResourceManager *rm);

	GObject(float x,float y, int resourceName);

	GObject(const GObject &object);

	~GObject(void);

	virtual void Render();
	virtual void Move(){};

	void setStepPercent(float percent);
	virtual RECT getRect();
	Vector getPosition();
	void setSprite(const Sprite& sprite);
	shared_ptr<Sprite> getSprite(){return _sprite;};

	bool isMovable();

	virtual CPolygon getPolygon();

	void setRM(CResourceManager *rm){ _rm = rm;};

	Vector getLastTranslateVector(){return _lastTranslateVector;};

	Vector getVelocityVector();

	void setVelocity(Vector v);

	void setPushBackVector(const Vector &PVector);

	Vector getPushBackVector();

	void setResourceManager(CResourceManager* rm){ _rm = rm;};

};